import http from "../utils/request";
//获取学生信息列表
export const getStudentsList = (page, count = 10, classes) =>
  http.get("/students/getstulist", {
    params: {
      page,
      count,
      class: classes,
    },
  });
//搜索信息列表
export const searchStudentsList = (key, page = 1, count = 10) =>
  http.get("/students/searchstu", {
    params: {
      key,
      page,
      count,
    },
  });
//删除学生信息接口
export const delStudentsList = (id) =>
  http.get("/students/delstu", {
    params: {
      sId: id,
    },
  });

//添加学生列表
export const addStudentsList = (data) =>
  http.post("/students/addstu", {
    ...data,
  });

//修改学生信息
export const editStudentsList = (data) =>
  http.post("/students/updatestu", data);

//上传图片
export const uploadAvatar = (avatar) =>
  http.post("/students/uploadStuAvatar", {
    headimgurl: avatar,
  });
